package com.lds.config.center.server.business.namespace.converter;

import com.lds.config.center.common.model.namespace.request.NamespaceBaseGetByKeyRequest;
import com.lds.config.center.server.business.namespace.entity.Namespace;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class NamespaceBaseGetByKeyRequestToEntityConverter implements Converter<NamespaceBaseGetByKeyRequest, Namespace> {

    @Override
    public Namespace convert(NamespaceBaseGetByKeyRequest source) {
        return Namespace.builder()
                .name(source.getName())
                .appId(source.getAppId())
                .build();
    }

}